#include "Time.h"

void hxe::Time::update()
{
    float currentFrame = (float)glfwGetTime();
    if (lastTime == 0.0f)
    {
        lastTime = currentFrame;
        return;
    }

    deltaTime = currentFrame - lastTime;
    lastTime = currentFrame;
}

float hxe::Time::getDeltaTime() const
{
    return deltaTime;
}

hxe::Time::Time()
{
    deltaTime = 0.033f;
    lastTime = 0.0f;
}


